<template>
	<div class="mask">
		<div class="TMB-warp">
			<div class="titler border-bottom">
				<span class="font-w fs16">カテゴリ選択</span>
				<i class="el-icon-close" @click="CloseTables"></i>
			</div>
			<div class="middle-box">
				<div class="row font-w">
					<i>カテゴリ</i>
					<el-select v-model="selectValue" placeholder=" ">
						<el-option v-for="item in selectList" :key="item.key" :label="item.label" :value="item.label">
						</el-option>
					</el-select>
				</div>
				<div class="row font-w">
					登録後にカテゴリの変更は出来ませんのでこ注意下さい。
				</div>
			</div>
			<div class="footer">
				<p></p>
				<div>
					<el-button size="small" @click="CloseTables">Cancel</el-button>
					<el-button type="primary" size="small" @click="okFn">OK</el-button>
				</div>
			</div>
		</div>
	</div>
</template>

<script>
import BASE from '@/utils/base'
import { getBasicStyleCtgList } from '@/api/api'
import eventBus from "@/eventBus/bus";

export default {
	name: "RightTabelAdd",
	props: {

	},
	data() {
		return {
			selectValue: '',
			selectList: []

		};
	},
	components: {},
	watch: {},
	methods: {
		okFn() {
			console.log(111);
			this.$emit('getctgCodeValue1', this.selectValue, 1);


			setTimeout(() => {
				this.$emit('getBasicStyleProInfoApi');
				this.$emit('hidden');

			}, 300);
		},
		CloseTables() {
			this.$emit('hidden')
		},
		async getSelect() {
			let res = await getBasicStyleCtgList({ MacType: this.$store.state.macType });
			this.selectList = res.data.data;
			this.selectValue = res.data.data[0].label;
		},
		initFn() {
			this.getSelect();
		}
	},
	created() { },
	mounted() {
		this.initFn();
	},
	beforeDestroy() { },
	destroyed() { }
};
</script>
<style lang="scss" scoped>
.mask {
	width: 100vw;
	height: 100vh;
	position: fixed;
	top: 0;
	left: 0;
	z-index: 500;
}

.TMB-warp {
	width: 588px;
	background: rgb(255, 255, 255);
	position: fixed;
	top: 50%;
	left: 50%;
	transform: translateX(-50%) translateY(-50%);
	box-shadow: 0px 12px 48px 16px rgba(0, 0, 0, 0.05),
		0px 9px 28px 0px rgba(0, 0, 0, 0.08), 0px 6px 16px -8px rgba(0, 0, 0, 0.15);
	z-index: 100;
}

.titler {
	height: 50px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 13px 24px;

	i {
		cursor: pointer;
	}
}

.middle-box {
	// height: calc(100% - 100px);
	padding: 0px 0 15px 0;

	.row {
		padding: 24px 24px 0 30px;

		i {
			margin-right: 24px;
		}

		.el-select {
			width: 372px;
			height: 32px;
		}
	}

}

.footer {
	height: 50px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 13px 24px;

	button {
		width: 76px !important;
		// margin-left: 16px;
		// color: #ffffff;
		// background: #106ebe;
	}
}

.font-w {
	font-weight: bold;
}

.border-top {
	border-top: 1px solid #f0f0f0;
}

.border-bottom {
	border-bottom: 1px solid #f0f0f0;
}

.border-left {
	border-left: 1px solid #f0f0f0;
}

.border-right {
	border-right: 1px solid #f0f0f0;
}

.gray {
	color: #7B7B7B;
}

.mar8 {
	margin-right: 8px;
}

.fs16 {
	font-size: 16px;
}
</style>
